<!--
 * @Description: 绝对定位
 * @Author: zzj
 * @Date: 2021-08-18 14:51:09
 * @LastEditors: zzj
 * @LastEditTime: 2021-08-18 14:53:44
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>绝对定位</title>
  <style>
    body {
      margin: 0;
    }
    .container {
        position: relative;
      width: 900px;
      background-color: lightskyblue;
      margin: 100px auto 0;

    }
    .one , .two{
      height: 100px;
    }
    .one {
      width: 500px;
      background-color: lightblue;
      opacity: .6;
    }
    .two {
      width: 600px;
      background-color: lightcoral;
    }
    .three {
      width: 800px;
      margin: 0 auto;
      height: 300px;
      background-color: lightcyan;
    }
    .four {
      width: 100px;
      height: 100px;
      background-color: lightpink;

      position: absolute;
      left: 10px;
      top: 10px;
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="one"></div>
    <div class="two"></div>
    <div class="three">
      <div class="four">绝对定位元素</div>
    </div>
  </div>
</body>
</html>
